home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / checkbox / patches / 0.7.2 < prev   
Text File  |  2009-11-05  |  684b  |  32 lines

  1. #!/usr/bin/python
  2.  
  3. import sys
  4.  
  5. from StringIO import StringIO
  6.  
  7.  
  8. def Config(filename):
  9.     globals = {}
  10.     module = "/usr/share/checkbox/install/config"
  11.     exec open(module) in globals
  12.     config = globals["Config"]()
  13.     config.read(filename)
  14.  
  15.     return config
  16.  
  17. def main(args):
  18.     config_file = "/etc/checkbox.d/%s.ini" % args[0]
  19.     config = Config(config_file)
  20.  
  21.     if config.has_section("checkbox/plugins") \
  22.        and not config.has_option("checkbox/plugins", "blacklist"):
  23.         config.set("checkbox/plugins", "blacklist", "backend_manager")
  24.  
  25.     # Rename options
  26.     file = open(config_file, "w")
  27.     config.write(file)
  28.  
  29.  
  30. if __name__ == "__main__":
  31.     main(sys.argv[1:])
  32.